package com.designpatterns.factory.factory3.stroe;

import com.designpatterns.factory.factory3.pizza.BasePizza;
import com.designpatterns.factory.factory3.constant.Consctant;
import com.designpatterns.factory.factory3.factory.NyPizzaIngredientFactory;
import com.designpatterns.factory.factory3.factory.PizzaIngredientFactory;
import com.designpatterns.factory.factory3.pizza.pizzaimp.CheeseBasePizza;
import com.designpatterns.factory.factory3.pizza.pizzaimp.ClamBasePizza;
import com.designpatterns.factory.factory3.pizza.pizzaimp.PepperoniBasePizza;
import com.designpatterns.factory.factory3.pizza.pizzaimp.VeggiesBasePizza;

/**
 * @author Brook
 */
public class ChicagoBasePizzaStore extends BasePizzaStore {

    @Override
    public BasePizza createPizza(String type) {
        BasePizza basePizza = null;
        PizzaIngredientFactory pizzaIngredientFactory = new NyPizzaIngredientFactory();
        if(Consctant.CHEESE.equals(type)) {
            basePizza = new CheeseBasePizza(pizzaIngredientFactory);
            basePizza.setName("Chicago Style Cheese Pizza");
        } else if(Consctant.VEGGIES.equals(type)) {
            basePizza = new VeggiesBasePizza(pizzaIngredientFactory);
            basePizza.setName("Chicago Style Veggies Pizza");
        } else if(Consctant.CLAM.equals(type)) {
            basePizza = new ClamBasePizza(pizzaIngredientFactory);
            basePizza.setName("Chicago Style Clam Pizza");
        } else if(Consctant.PEPPERONI.equals(type)) {
            basePizza = new PepperoniBasePizza(pizzaIngredientFactory);
            basePizza.setName("Chicago Style Pepperoni Pizza");
        }
        return basePizza;
    }
}
